<div class="reward_show">
  <el-table :data="filterTableData" style="width: 80%;left: 50px;margin-top: 50px;">
    <el-table-column label="名称" prop="reward_name">
      <template #default="scope">
        <el-input v-if="activeIndex == scope.$index" v-model="scope.row.reward_name"></el-input>
        <span v-else>{{ scope.row.reward_name }}</span>
      </template>
    </el-table-column>

    <el-table-column label="id" prop="reward_id">
      <template #default="scope">
        <el-input v-if="activeIndex == scope.$index" v-model="scope.row.reward_id"></el-input>
        <span v-else>{{ scope.row.reward_id }}</span>
      </template>
    </el-table-column>


    <el-table-column label="说明" prop="reward_desc">
      <template #default="scope">
        <el-input v-if="activeIndex == scope.$index" v-model="scope.row.reward_desc"></el-input>
        <span v-else>{{ scope.row.reward_desc }}</span>
      </template>
    </el-table-column>

    <el-table-column label="默认值" prop="reward_value">
      <template #default="scope">
        <el-input v-if="activeIndex == scope.$index" v-model="scope.row.reward_value"></el-input>
        <span v-else>{{ scope.row.reward_value }}</span>
      </template>
    </el-table-column>

    <el-table-column align="right">
      <template #header>
        <el-input v-model="search" size="small" placeholder="Type to search" />
      </template>
      <template #default="scope">
        <el-button v-if="activeIndex == scope.$index" size="small" type="primary"
          @click="handleSave">保存</el-button>
        <el-button v-else size="small" type="success" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        <el-button size="small" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
  <el-button class="mt-4" style="position: relative; width: 80%;left:50px" @click="onAddItem">新建变量</el-button>
</div>